import { _decorator, Component, director } from 'cc';
import { Ab_ClientAPI_bA } from './api/client.api';
const { ccclass, property } = _decorator;

@ccclass('Ab_LoadScene_bA')
export class Ab_LoadScene_bA extends Component {

	start(){
		this.Ab_adaptUI_bA();
		this.Ab_EnterGame_bA();
	}

	private Ab_adaptUI_bA(){
		abi.Ab_cc_bA.Ab_adaptBackgroundNode_bA(this.node.getChildByName('background'));
	}

	private async Ab_EnterGame_bA(){
		let scene_name = ({
			A: 'game',
			B: 'main',
			Test: 'test'
		})[await Ab_ClientAPI_bA.Ab_GameType_bA()];

		director.preloadScene(scene_name, ()=>{
			director.loadScene(scene_name);
		});
	}
}

